package com.situ.user.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import com.situ.user.service.OrderService;

//清理无效订单
@Component
public class CleanOrderInterceptor implements HandlerInterceptor {

	@Autowired
	private OrderService orderService;

	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		// 清理无效订单
		orderService.clean();
		// 放行
		return true;
	}
}
